package com.proton.carepatchtemp.utils;

import android.support.annotation.LayoutRes;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

/**
 * Created by Api on 2016/10/9.
 */

public class RvUtils {
    public static View getMyView(@LayoutRes int resid, ViewGroup viewGroup) {
        View view = LayoutInflater.from(viewGroup.getContext()).inflate(resid, viewGroup, false);
        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        view.setLayoutParams(lp);
        return view;
    }

    public static View getMyViewAsIs(@LayoutRes int resid, ViewGroup viewGroup) {
        View view = LayoutInflater.from(viewGroup.getContext()).inflate(resid, viewGroup, false);
        return view;
    }
}
